﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using KPIS.GERP.GHRMS.DAL;
using KPIS.GERP.GHRMS.IDAL;
using KPIS.GERP.GHRMS.MODEL;
using KPIS.GERP.GHRMS.IBLL;

namespace KPIS.GERP.GHRMS.BLL
{
    public class TrainingCoursesTrainerBLL : ITrainingCoursesTrainerBLL
    {
        private static readonly ITrainingCoursesTrainerDAL dal = new TrainingCoursesTrainerDAL();
        TrainingCoursesTrainerInfo info = new TrainingCoursesTrainerInfo();
        ConvertNullable cn = new ConvertNullable();

        public IList<TrainingCoursesTrainerInfo> GetFull(string CourseSeq)
        {
            Nullable<int> nCourseSeq = cn.ConvertNullInt(CourseSeq);
            return dal.GetFull(nCourseSeq);
        }

        public IList<TrainingCoursesTrainerInfo> GetList(string Sequence)
        {
            Nullable<int> nSequence = cn.ConvertNullInt(Sequence);
            return dal.GetFull(nSequence);
        }

        public void Insert(Nullable<int> trainer_seq, int train_seq, string remarks, Nullable<int> created_by)
        {
            info.TrainerSeq = trainer_seq;
            info.TrainSeq = train_seq;
            info.Remarks = remarks;
            info.CreatedBy = created_by;
            dal.Insert(info);

        }

        public void Update(int course_trainer_seq, Nullable<int> trainer_seq, int train_seq, string remarks, Nullable<int> updated_by)
        {
            info.Sequence = course_trainer_seq;
            info.TrainerSeq = trainer_seq;
            info.TrainSeq = train_seq;
            //info.TrainingSubjectSeq = training_subject_seq;
            //info.TrainingSubjectDtlsSeq = training_subject_dtls_seq;
            info.Remarks = remarks;
            info.UpdatedBy = updated_by;
            dal.Update(info);
        }

        public void Delete(int Sequence, int updated_by)
        {
            dal.Delete(Sequence, updated_by);
        }

        public DataTable LoadPerson()
        {
            return dal.LoadPerson();
        }
    }
}
